package com.kjsdfgk.hjmdsf.ftvdolist.mvp.ui.fragment;

import android.content.Intent;
import android.net.Uri;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.kjsdfgk.hjmdsf.app.entity.Account;
import com.kjsdfgk.hjmdsf.app.entity.ListBean;
import com.kjsdfgk.hjmdsf.app.entity.XJVideoJson;
import com.kjsdfgk.hjmdsf.app.msg.AddViewMsg;
import com.kjsdfgk.hjmdsf.ftvdolist.mvp.bean.XJVideo;
import com.kjsdfgk.hjmdsf.video.mvp.ui.activity.VideoActivity;
import com.lksdkjs.live.R;

import org.greenrobot.eventbus.EventBus;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

/**
 * @author flymegoc
 * @date 2017/11/14
 */

public class
V91PornAdapter extends BaseQuickAdapter<ListBean , BaseViewHolder> {

    public V91PornAdapter(int layoutResId, List<ListBean> datas) {
        super(layoutResId,datas);
    }

    @Override
    protected void convert(BaseViewHolder helper, ListBean item) {

        if (item.getType_id() == 2100 || item.getType_id() == 2200){
            helper.setText(R.id.tv_91porn_item_title, item.getVod_name());
        }else {
            helper.setText(R.id.tv_91porn_item_title, item.getVod_name() + "  (" +item. getVod_duration() +"分钟"+ ")");
        }
        helper.setText(R.id.tv_91porn_item_info, item.getVod_score()+"分");
        String strDateFormat = "yyyy/MM/dd";
        SimpleDateFormat dateFormat = new SimpleDateFormat(strDateFormat);
        helper.setText(R.id.tv_91porn_item_time, dateFormat.format(new Date(item.getVod_time()*1000L)));
        ImageView simpleDraweeView = helper.getView(R.id.iv_91porn_item_img);
        Uri uri = Uri.parse(item.getVod_pic());
        Glide.with(helper.itemView).load(uri).placeholder(R.mipmap.img_loading).transition(new DrawableTransitionOptions().crossFade(300)).into(simpleDraweeView);


    }
}
